﻿using Bandit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ETC.DLEDPositionTool.Windows
{
    /// <summary>
    /// FrmAbout.xaml 的交互逻辑
    /// </summary>
    public partial class FrmAbout : BanditWindow
    {
        public FrmAbout()
        {
            InitializeComponent();

            this.Loaded += delegate
            {
                var assembly = Application.ResourceAssembly.GetName();

                int major = assembly.Version.Major;
                int minor = assembly.Version.Minor;
                int build = assembly.Version.Build;
                int revision = assembly.Version.Revision;

                this.txtbSoftwareVersion.Text = string.Format("{0} v{1}.{2}{3}{4}", assembly.Name,
                                                                             major,
                                                                             minor,
                                                                             build == 0 ? "" : "." + build.ToString(),
                                                                             revision == 0 ? "" : (build == 0 ? ".0." : ".") + revision.ToString());
            };

            txtHistoryUpdate.Text =
@" * V1.0.0.0 - 2020年09月18日                                       
 * 初始版本
";
        }

        internal static void Show(Window window)
        {
            FrmAbout frm = new FrmAbout();
            frm.Owner = window;
            frm.ShowDialog();
        }
    }
}
